/**
 * @Author: huangcc
 * @Date: 2022-04-16
 * @Last Modified by: huangcc
 * @Last Modified time: 2022-04-24
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 列表查询
export const queryList = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/queryList/sh`, params)
// 列表查询
export const getOrderBill = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/getOrderBill`, params)

export const saveOrderBill = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/saveOrderBill`, params)
// 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);
// 审核确认
export const confirmOrder = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/confirmOrder`, params)


export const saveOrder = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/saveOrder`, params)

// 查询详情
export const getDetail = (params) => axios.get(`${SERVER.WHOLESALES}/orderDeliveryManage/getOrderById`, { params })

// 经销商账户资金类型列表
export const getTtFiAccountList = (params) => axios.post(`${SERVER.WHOLESALES}/ttFiAccount/list`, params)
// 资金调整页面信息
export const detailFundAdjust = (params) => axios.post(`${SERVER.WHOLESALES}/ttVsDeliveryOrder/detailFundAdjust`, params)



// 车辆配置五级选择
export const vehicleConfiguration = (id, params) => axios.get(`${SERVER.BASEDATA}/vehicleProduct/productInfo/productTreeNew`, { params: { type: id, level: 6, ...params } });

//模板
export const excelTemplate = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/exportTemplateDelivery`, params, { responseType: 'blob' })

export const getDealerAddress = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/dealerAddress`, params)
export const dealerAccount = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/dealerAccount`, params)

// 收车地址调整
export const getconfirmAddressAdjust = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/confirmAddressAdjust`, params)
// 资金调整确认
export const confirmFundAdjust = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/confirmFundAdjust`, params)

// 取消订单
export const cancelOrder = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/cancelOrder`, params)
// 审核驳回
export const postrejectCheck = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/rejectOrder`, params)
// 导出
export const excelList = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/excel/sh`, params, { responseType: 'blob' })

export const allAccountType = (params) => axios.post(`${SERVER.WHOLESALES}/orderDeliveryManage/allAccountType`, params)
export const queryOrderLog = (params) => axios.get(`${SERVER.WHOLESALES}/commonMethod/queryOrderLog?orderId=${params}`, { params })